home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
program
/
freeli22.zip
/
SPLIT.C
< prev
next >
Wrap
Text File
|
1996-09-01
|
814b
|
38 lines
#include <stdio.h>
#include <string.h>
char s[160];
main(int argc, char *argv[])
{
int ctr = 0;
FILE *fp = NULL;
while(!feof(stdin))
{
gets(s);
if(s[0] == '~' && s[1] == '~' && s[2] == '~')
{
if(fp)
{
printf(" ");
if(!(ctr = (ctr + 1) % 6))
printf("&\n");
fclose(fp);
}
printf("+%s", s + 3);
strcat(s, ".ASM");
fp = fopen(s + 3, "wt");
} else {
if(fp) fprintf(fp, "%s\n", s);
}
}
if(argc > 1) printf(" &");
printf("\n");
return 0;
}